RedDiscapacidad = function(){
	var redDemandanteFolio = null;
	return {
		setRedDemandanteFolio: function(value){redDemandanteFolio = value;},
		getRedDemandanteFolio: function(){return redDemandanteFolio;},
		move: function(layout, direction){
			layout[direction]();
			Ext.getCmp("redDiscapacidadSiguienteButton").setDisabled(!layout.getPrev());
		    Ext.getCmp("redDiscapacidadAnteriorButton").setDisabled(!layout.getNext());
		},
		navigate: function(panel, direction){
		    var layout = panel.getLayout();
		    var form = layout.getActiveItem();
		    var formId = form.getId();
		    var jsonParams = {};
		    if(formId == "redDiscapacidadPaso3"){
		    	RedDiscapacidad.move(layout, direction);
		    	return;
		    }else{
		    	if(Ext.isEmpty(RedDiscapacidad.getRedDemandanteFolio())) {
					Asg.Message.alertInvalid("Debe Guardar los datos del demandante antes de continuar");
					return;
				}
				var path = "/red/discapacidad/";
				var params = {};
				switch(formId){
					case "redDiscapacidadFisicoPsiquicoForm":
						path += "saveRedFisicoPsiquico";
						params["redFisicoPsiquico.redDemandante.redDemandanteFolio"] = RedDiscapacidad.getRedDemandanteFolio();
						break;
					case "redDiscapacidadTrabajoForm":
						path += "saveRedDiscapacidadTrabajo";
						params["redTrabajo.redDemandante.redDemandanteFolio"] = RedDiscapacidad.getRedDemandanteFolio();
						break;
					default: return;
				}
				Asg.Message.progress("Guardando Informaci\u00F3n...");
				form.getForm().submit({
	    			url: Asg.constants.CONTEXT_PATH + path,
	    			timeout: Asg.constants.TIMEOUT_SECONDS,
	    			params: params,
	    			success: function(form, action){
	    				Asg.Message.alert(action.result.message);
						if(action.result.success){
							RedDiscapacidad.move(layout, direction);
							if(action.result.redFisicoPsiquicoId)
								Asg.Utils.setValue("redFisicoPsiquicoId", action.result.redFisicoPsiquicoId);
								if(action.result.redTrabajoId)
									Asg.Utils.setValue("redTrabajoId", action.result.redTrabajoId);
							
						}
	    			},
	    			failure: Asg.Form.failureProcedure
	   			});
		    }
		},
		openWindow: function(redDemandanteId){
			Asg.Message.progress("Cargando Informaci\u00F3n...");
            Ext.Ajax.request({
                timeout: Asg.constants.TIMEOUT_SECONDS,
                url: Asg.constants.CONTEXT_PATH + "/red/discapacidad/findById",
                params: {redDemandanteId: redDemandanteId},
                callback: function(options, success, response){
                    Ext.Msg.hide();
                    var jsonObject = Asg.Utils.ajaxRequestGetJson(response);
                    if(!success || !jsonObject || jsonObject.failure){
                        Asg.Message.alertInvalid(Asg.constants.DEFAULT_ERROR_MESSAGE);
                        return
                    }
                    RedDiscapacidad.showWindow(jsonObject);
                }
            });
		},
		showWindow: function(config){
			if(!config) config = {};
			if(config.redDemandanteId) RedDiscapacidad.setRedDemandanteFolio(config.redDemandanteId);
			new Ext.Window({
				width: 850,
				height: 500,
				layout: "fit",
				id: "redDiscapacidadWindow",
				maximizable: true,
				modal: true,
				title: Asg.constants.APPLICATION_TITLE,
				listeners: {
					show: function(){
						try{
							Asg.Form.setValues("redDiscapacidadFisicoPsiquicoForm", config.redFisicoPsiquico);
							Asg.Form.setValues("redDiscapacidadTrabajoForm", config.redTrabajo);
						}catch(e){
							if(console && console.log) console.log(e);
						}
					}
				},
				items: {
					border: false,
					layout: "card",
					//activeItem: 1,
					items: [
				        {
				        	xtype: "form",
				        	id: "redDiscapacidadFisicoPsiquicoForm",
				        	title: "Paso #1: Potencias Fisico y Psiquico",
				        	border: false,
	        	        	bodyPadding: "5 5 5 5",
	        	        	autoScroll: true,
	        	        	layout: {
	        	        		type: "table",
								columns: 3,
								tableAttrs: {
						            style: {width: "795px", "margin-top": "5px;"},
						            align: "center"
								}
	        	        	},
	        	        	defaults: Asg.Form.defaults({width: 260, height: 130}),
	        	        	items: [
    	        	        	{xtype: "label", text: "- Postura -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "De Pie",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaDePie", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaDePie", inputValue: "2", boxLabel: "Periodos Cortos"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaDePie", inputValue: "3", boxLabel: "Casi toda la jornada"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaDePie", inputValue: "4", boxLabel: "Toda la jornada de trabajo"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Sentado",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaSentado", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaSentado", inputValue: "2", boxLabel: "Periodos Cortos"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaSentado", inputValue: "3", boxLabel: "Casi toda la jornada"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaSentado", inputValue: "4", boxLabel: "Toda la jornada de trabajo"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Otra",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaOtra", inputValue: "1", boxLabel: "Ninguna"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaOtra", inputValue: "2", boxLabel: "Forma ocasional"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoPosturaOtra", inputValue: "3", boxLabel: "Cualquier postura"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Locomoci\u00F3n -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Caminar",
        	        	        	height: 150,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocionCaminar", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocionCaminar", inputValue: "2", boxLabel: "Periodos Cortos"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocionCaminar", inputValue: "3", boxLabel: "	Necesita descanso ocasional"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocionCaminar", inputValue: "4", boxLabel: "Toda la jornada"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Subir Escaleras",
        	        	        	height: 150,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioEscaleras", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioEscaleras", inputValue: "2", boxLabel: "Lentamente"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioEscaleras", inputValue: "3", boxLabel: "Poca dificultad"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioEscaleras", inputValue: "4", boxLabel: "Sin dificultad"},
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Levantar y Transportar",
        	        	        	height: 150,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioTransportar", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioTransportar", inputValue: "2", boxLabel: "Hasta 20 lbs."},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioTransportar", inputValue: "3", boxLabel: "Hasta 40 lbs."},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioTransportar", inputValue: "4", boxLabel: "Hasta 60 lbs."},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoLocomocioTransportar", inputValue: "5", boxLabel: "M\u00E1s de 60 lbs."}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Extremidades Superiores -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Movimiento",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Movimiento", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Imposible", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Menor a 30 cms.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Menor a 60 cms.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorMovimientoDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Menor a 80 cms.", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Fuerza",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Fuerza", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Imposible", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Hasta 20 lbs.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Hasta 35 lbs.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorFuerzaDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "M\u00E1s de 35 lbs.", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Precisi\u00F3n",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Precisi\u00F3", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Imposible", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "No requiere especial precisi\u00F3n", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Menos preci\u00F3n", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadSuperiorPrecionDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Con preci\u00F3n", cls: "x-form-item"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Extremidades Inferiores -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Movilidad",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	colspan: 3,
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Movilidad", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Imposible", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Movilidad Limitada", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Con alguna frecuencia", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoExtremidadInferiorMovimientoDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Constantemente", cls: "x-form-item"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Audici\u00F3n -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Capacidad Auditiva",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Capacidad Auditiva", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Imposible", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Limitada", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Normal", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionCapacidadDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Excelente", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Hablar",
        	        	        	height: 140,
        	        	        	colspan: 2,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionHablar", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionHablar", inputValue: "2", boxLabel: "Limitada"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionHablar", inputValue: "3", boxLabel: "Normal"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAudicionHablar", inputValue: "4", boxLabel: "Excelente"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Visi\u00F3n -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Pr\u00F3xima",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Pr\u00F3xima", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Ciega", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Poca agudez visual", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Suficiente agudeza visual", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionProximaDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Buena agudeza visual", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Lejana",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Lejana", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Ciega", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Distancia de hasta 2 mts.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaIzq", inputValue: "3", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaDer", inputValue: "3", width: 30},
    	        	        	        {xtype: "label", text: "Distancia de hasta 4 mts.", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaIzq", inputValue: "4", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionLejanaDer", inputValue: "4", width: 30},
    	        	        	        {xtype: "label", text: "Distancia mayor de 4 mts.", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Diferencia Colores",
        	        	        	height: 140,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Diferencia Colores", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionColoresIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionColoresDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "No diferencia", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionColoresIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionColoresDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Puede diferenciar", cls: "x-form-item"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Perspectiva",
        	        	        	colspan: 3,
        	        	        	layout: {
        	        	        		type: "table",
        								columns: 3
        	        	        	},
        	        	        	items: [
    	        	        	        {xtype: "label", text: "Izq.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Der.", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "label", text: "Perspectiva", cls: "x-form-item", style: "text-align: center; font-weight: bold"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionPerspectivaIzq", inputValue: "1", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionPerspectivaDer", inputValue: "1", width: 30},
    	        	        	        {xtype: "label", text: "Sin Perspectiva", cls: "x-form-item"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionPerspectivaIzq", inputValue: "2", width: 30},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoVisionPerspectivaDer", inputValue: "2", width: 30},
    	        	        	        {xtype: "label", text: "Posee Perspectiva", cls: "x-form-item"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Potencial Ps\u00EDquico: -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Atenci\u00F3n",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAtencion", inputValue: "1", boxLabel: "Ninguna"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAtencion", inputValue: "2", boxLabel: "Poca atenci\u00F3n"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAtencion", inputValue: "3", boxLabel: "Normal"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoAtencion", inputValue: "4", boxLabel: "Excelente"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Memoria",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoMemoria", inputValue: "1", boxLabel: "Escasa memoria"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoMemoria", inputValue: "2", boxLabel: "Poca memoria"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoMemoria", inputValue: "3", boxLabel: "Normal"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoMemoria", inputValue: "4", boxLabel: "Excelente"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Capacidad de Decisi\u00F3n e Iniciativa",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoDecision", inputValue: "1", boxLabel: "Imposible"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoDecision", inputValue: "2", boxLabel: "Con criterios"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoDecision", inputValue: "3", boxLabel: "Normal"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoDecision", inputValue: "4", boxLabel: "Excelente"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Estabilidad Emocional",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoEstabilidadEmocional", inputValue: "1", boxLabel: "Alta inestabilidad"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoEstabilidadEmocional", inputValue: "2", boxLabel: "Ocasional altibajo"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoEstabilidadEmocional", inputValue: "3", boxLabel: "Estabilidad emocional"},
    	        	        	        {xtype: "radio", name: "redFisicoPsiquico.redFisicoPsiquicoEstabilidadEmocional", inputValue: "4", boxLabel: "Gran estabilidad"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "hidden",
        	        	        	id: "redFisicoPsiquicoId",
        	        	        	name: "redFisicoPsiquico.redFisicoPsiquicoId"
        	        	        }
    	        	        ]
				        },{
				        	xtype: "form",
				        	id: "redDiscapacidadTrabajoForm",
				        	title: "Paso #2: Trabajo en Condiciones Especiales",
				        	border: false,
	        	        	bodyPadding: "5 5 5 5",
	        	        	autoScroll: true,
	        	        	layout: {
	        	        		type: "table",
								columns: 3,
								tableAttrs: {
						            style: {width: "795px", "margin-top": "5px;"},
						            align: "center"
								}
	        	        	},
	        	        	defaults: Asg.Form.defaults({width: 260, height: 130}),
	        	        	items: [
    	        	        	{xtype: "label", text: "- Tipo de Trabajo en el que puede desempe\u00F1arse -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Trabajo Individual",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIndividual", inputValue: "1", boxLabel: "Ayuda frecuente"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIndividual", inputValue: "2", boxLabel: "Ayuda eventual"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIndividual", inputValue: "3", boxLabel: "Sin ayuda"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Trabajo Grupal",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoGrupal", inputValue: "1", boxLabel: "Alta dificultad"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoGrupal", inputValue: "2", boxLabel: "Alguna dificultad"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoGrupal", inputValue: "3", boxLabel: "Facilidad de trabajo"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "M\u00E1quinas Autom\u00E1ticas",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaAutomatica", inputValue: "1", boxLabel: "Conoce poco"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaAutomatica", inputValue: "2", boxLabel: "Algun conocimiento"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaAutomatica", inputValue: "3", boxLabel: "Amplio conocimiento"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "M\u00E1quinas Manuales",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaManual", inputValue: "1", boxLabel: "Conoce poco"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaManual", inputValue: "2", boxLabel: "Algun conocimiento"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaManual", inputValue: "3", boxLabel: "Amplio conocimiento"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "M\u00E1quinas de Ritmo Fijo",
        	        	        	colspan: 2,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaRitmo", inputValue: "1", boxLabel: "Ningun conocimiento"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaRitmo", inputValue: "2", boxLabel: "Algun conocimiento"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoMaquinaRitmo", inputValue: "3", boxLabel: "Amplio conocimiento"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Ambiente en el que puede trabajar -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "fieldset",
        	        	        	title: "Ruido",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoRuido", inputValue: "1", boxLabel: "Se altera"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoRuido", inputValue: "2", boxLabel: "Se incomoda"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoRuido", inputValue: "3", boxLabel: "Tolera ruidos"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Iluminaci\u00F3n",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIluminacion", inputValue: "1", boxLabel: "Iluminaci\u00F3n \u00F3ptima"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIluminacion", inputValue: "2", boxLabel: "Iluminaci\u00F3n normal"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoIluminacion", inputValue: "3", boxLabel: "Iluminaci\u00F3n pobre"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Ventilaci\u00F3n",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVentilacion", inputValue: "1", boxLabel: "Ventilaci\u00F3n \u00F3ptima"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVentilacion", inputValue: "2", boxLabel: "Ventilaci\u00F3n normal"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVentilacion", inputValue: "3", boxLabel: "Ventilaci\u00F3n pobre"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Temperatura",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoTemperatura", inputValue: "1", boxLabel: "Condici\u00F3n especial de temperatura"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoTemperatura", inputValue: "2", boxLabel: "Temperatura entre 18 y 25 grados"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoTemperatura", inputValue: "3", boxLabel: "No afecta la temperatura"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Humedad",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoHumedad", inputValue: "1", boxLabel: "No tolera ambiente con humedad"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoHumedad", inputValue: "2", boxLabel: "Alguna dificultad en ambiente humedo"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoHumedad", inputValue: "3", boxLabel: "Tolera ambiente humedo"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Polvo",
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoPolvo", inputValue: "1", boxLabel: "No tolera ambiente con polvo"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoPolvo", inputValue: "2", boxLabel: "Alguna dificultad en ambiente con polvo"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoPolvo", inputValue: "3", boxLabel: "Tolera ambiente con polvo"}
	        	        	        ]
        	        	        },{
        	        	        	xtype: "fieldset",
        	        	        	title: "Vibraciones",
        	        	        	colspan: 3,
        	        	        	items: [
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVibracion", inputValue: "1", boxLabel: "No tolera ambiente con vibraciones"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVibracion", inputValue: "2", boxLabel: "Toleraci\u00F3n moderada en ambiente con vibraciones"},
    	        	        	        {xtype: "radio", name: "redTrabajo.redTrabajoVibracion", inputValue: "3", boxLabel: "Tolera ambiente con vibraciones"}
	        	        	        ]
        	        	        },
        	        	        {xtype: "label", text: "- Otras habilidades y capacidades desarrolladas: -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
        	        	        	xtype: "textarea",
        	        	        	name: "redTrabajo.redTrabajoOtrasHabilidades",
        	        	        	height: 50,
        	        	        	width: 780,
        	        	        	colspan: 3
        	        	        },
        	        	        {xtype: "label", text: "- Usa alg\u00FAn ayuda t\u00E9cnica: -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 3},
        	        	        {
    	        	        		xtype: 'checkboxgroup',
    	        	        		colspan: 3,
    	        	        		columns: 4,
    	        	        		vertical: true,
    	        	        		maxHeight: 50,
    	        	        		height: 50,
    	        	        		autoScroll: true,
    	        	        		width: 780,
    	        	        		items: config.redAyudaTecnica || []
    	        	        	},{
    	        	        		xtype: "label", 
    	        	        		text: "Si ha seleccionado la opci\u00F3n de otro, por favor especifique:", 
    	        	        		cls: "x-form-item", 
    	        	        		style: "text-align: center;", 
    	        	        		colspan: 2
	        	        		},{
	        	        			xtype: "textfield",
	        	        			name: "redTrabajo.redTrabajoAyudaTecnicaOtro",
	        	        			height: 20
	        	        		},{
	        	        			xtype: "hidden",
	        	        			id: "redTrabajoId",
	        	        			name: "redTrabajo.redTrabajoId"
	        	        		}
        	        	        
	        	        	]
				        },{
				        	xtype: "form",
				        	id: "redDiscapacidadPaso3",
				        	title: "Paso #3: Revisi\u00F3n de la Informaci\u00F3n",
				        	border: false,
				        	items: [
			        	        {xtype: "label", text: "Datos completados y guardados", cls: "x-form-item"}
		        	        ]
				        }
			        ],
			        bbar: [
		               "->",
		               {
		            	   text: "Anterior",
		            	   id: "redDiscapacidadSiguienteButton",
		            	   handler: function(btn) {
		            		   RedDiscapacidad.navigate(btn.up("panel"), "prev");
		                   },
		                   disabled: true
		               },"-",
		               {
		            	   text: "Siguiente",
		            	   id: "redDiscapacidadAnteriorButton",
		            	   handler: function(btn) {
		            		   RedDiscapacidad.navigate(btn.up("panel"), "next");
		                   }
		               }, "-",
		               {
		            	   text: "Cerrar",
		            	   handler: function(){
		            		   Ext.WindowMgr.get("redDiscapacidadWindow").close();
	            		   }
		               }
	                ]
				}
			}).show();
		}
	};
}();